package com.bdqn.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@Controller
public class UsersController {
    @Autowired
    RestTemplate restTemplate;
    @GetMapping("/tt")
    @ResponseBody
    public String test(){
        System.out.println("客户端");
        String s=restTemplate.getForObject("http://server/uuservice?s=你好",String.class);
        return "xxx"+s;
    }

    @RequestMapping("/")
    @ResponseBody
    public String ss(){
        return "kkkkk";
    }
}
